#include<cmath>
class Solution {
public:
    int gcd(int a,int b)
    {
        while(b!=0)
        {
            int tmp = a%b;
            a = b;
            b = tmp;
        }
        return a;
    }
    int cal_max_common_factor(int* L, int LLen) 
    {
        if(LLen<2)
        {
            return L[0];
        }
        int ret = gcd(L[0],L[1]);
        for(int i = 2;i<LLen;i++)
        {
            ret = gcd(ret,L[i]);
        }
        return ret;
    }
};